package com.ruoyi.admin.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.admin.mapper.ZhxSubscribeMapper;
import com.ruoyi.admin.domain.ZhxSubscribe;
import com.ruoyi.admin.service.IZhxSubscribeService;

/**
 * 用户订阅Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-11
 */
@Service
public class ZhxSubscribeServiceImpl implements IZhxSubscribeService 
{
    @Autowired
    private ZhxSubscribeMapper zhxSubscribeMapper;

    /**
     * 查询用户订阅
     * 
     * @param subscribeId 用户订阅主键
     * @return 用户订阅
     */
    @Override
    public ZhxSubscribe selectZhxSubscribeBySubscribeId(Long subscribeId)
    {
        return zhxSubscribeMapper.selectZhxSubscribeBySubscribeId(subscribeId);
    }

    /**
     * 查询用户订阅列表
     * 
     * @param zhxSubscribe 用户订阅
     * @return 用户订阅
     */
    @Override
    public List<ZhxSubscribe> selectZhxSubscribeList(ZhxSubscribe zhxSubscribe)
    {
        return zhxSubscribeMapper.selectZhxSubscribeList(zhxSubscribe);
    }

    /**
     * 新增用户订阅
     * 
     * @param zhxSubscribe 用户订阅
     * @return 结果
     */
    @Override
    public int insertZhxSubscribe(ZhxSubscribe zhxSubscribe)
    {
        zhxSubscribe.setCreateTime(DateUtils.getNowDate());
        return zhxSubscribeMapper.insertZhxSubscribe(zhxSubscribe);
    }

    /**
     * 修改用户订阅
     * 
     * @param zhxSubscribe 用户订阅
     * @return 结果
     */
    @Override
    public int updateZhxSubscribe(ZhxSubscribe zhxSubscribe)
    {
        zhxSubscribe.setUpdateTime(DateUtils.getNowDate());
        return zhxSubscribeMapper.updateZhxSubscribe(zhxSubscribe);
    }

    /**
     * 批量删除用户订阅
     * 
     * @param subscribeIds 需要删除的用户订阅主键
     * @return 结果
     */
    @Override
    public int deleteZhxSubscribeBySubscribeIds(Long[] subscribeIds)
    {
        return zhxSubscribeMapper.deleteZhxSubscribeBySubscribeIds(subscribeIds);
    }

    /**
     * 删除用户订阅信息
     * 
     * @param subscribeId 用户订阅主键
     * @return 结果
     */
    @Override
    public int deleteZhxSubscribeBySubscribeId(Long subscribeId)
    {
        return zhxSubscribeMapper.deleteZhxSubscribeBySubscribeId(subscribeId);
    }
}
